﻿namespace TSP;

public class City
{
    public byte CityID { get; init; }

    public City(byte cityID) => CityID = cityID;

    public double DistanceTo(City city) => Distances != null ? Distances[CityID, city.CityID] : throw new Exception("邻接矩阵未定义");

    internal static double[,]? Distances { get; set; }
}
